package hibernate;

import hibernate.dao.PersonDAO;
import hibernate.dao.impl.PersonDaoImpl;

/**
 * @author Anastasiya Uryadkina
 * date: 19.04.2011	
 * time: 1:14:16
 * project: SimpleServer2rmi
 */
public class Factory
{
   private static PersonDAO personDao = null;
   private static Factory instance = null;

   public static synchronized Factory getInstance()
   {
      if (instance == null)
      {
         instance = new Factory();
      }
      return instance;
   }

   public PersonDAO getPersonDAO()
   {
      if (personDao == null)
      {
         personDao = new PersonDaoImpl();
      }
      return personDao;
   }
}
